package gao.xiaolei.copyEntity;

import gao.xiaolei.entity.TestRunLogStep;
import gao.xiaolei.entity.TestStepBase;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;

@Entity
@Data
public class TestRunLogStepCopy extends TestStepBase {

    @Column(columnDefinition = "char(32)")
    private String testRunLog;//所属的测试运行记录

    @Column
    private Integer isPass;//该测试步骤是否执行成功，0-不成功，1-成功，-1未选择

    @Column(columnDefinition = "char(32)")
    private String reasonId;//用于储存判断执行是否成功的理由的Id,用于定位文件

    @Column(columnDefinition = "char(40)")
    private String commitId;//git的提交Id

    @Transient
    private String reason;//用于储存判断执行是否成功的理由，但是不保存在数据库

    public TestRunLogStepCopy(TestRunLogStep testRunLogStep, String commitId) {
        super(testRunLogStep.getId(), testRunLogStep.getName(), testRunLogStep.getFrontNode(), testRunLogStep.getBackNode(), testRunLogStep.getExpectedResult());
        this.testRunLog = testRunLogStep.getTestRunLog();
        this.isPass = testRunLogStep.getIsPass();
        this.reasonId = testRunLogStep.getReasonId();
        this.commitId=commitId;
    }

    public TestRunLogStepCopy() {
    }
}
